/*
 * Copyright (c) 2009-2012 by Emagsoftware Inc., All rights reserved.
 *
 */
include "Errors.thrift"

namespace java com.emagsoftware.gamesdk.spec

enum GameType {
	DOWNLOAD_AND_PAY = 1,
	TRY_PLAY_AND_PAY = 2,
	PACKAGE_PAY = 3
}

struct UserTokenResult {
	1:  required string userToken,
	2:  optional i32 expirationSeconds
}

struct AuthenticationResult {
	1:  required string userId,
	2:  required i32 userIdType,
	3:  required string authenticationToken,
	4:  required GameType gameType,
	5:  required string fee,
	6:  optional string decipherKey,
	7:  optional string chargeConfirm	
}




service SDKAuthentication {

	UserTokenResult createUserToken(1: string imei,
					2: string imsi,
					3: string smsNonce,
					4: string gameId,
					5: string apiVersion,
					6: string sign)
					throws (1: Errors.SDKSystemException systemException),
	
				  
	AuthenticationResult authenticate(1:string imei,
					2:string imsi,
					3:string userToken,
					4:string gameId,
					5:string channelId,
					6:string apiVersion,
					7:string sign,
					8:map<string,string> extraAttributes)
					throws (1: Errors.SDKSystemException systemException)
}